/*
 * File Name:               CIntervalTimer.cs
 *
 * Description:             间隔计时
 * Author:                  lisiyu <576603306@qq.com>
 * Create Date:             2016/11/18
 */

using System;

public class CIntervalTimer : ICache
{
    private object mArgs;

    public Action<object> pCallback;
    public ulong pUid;
    public float pExcuteTime;
    public float pIntervalTime;

    public void onSpawn(object args)
    {
        mArgs = args;
    }

    public void onRecycle()
    {
        mArgs = null;
        pCallback = null;
    }

    public void excute()
    {
        pCallback(mArgs);
        pExcuteTime += pIntervalTime;
    }
}